#pragma once

class IClass1 {
	//.......
	friend class IClassBuilder;
};

/**
* Builder 负责实现构造步骤
*/
class IClassBuilder {
private:
	IClass1* iclass1;

public:
	~IClassBuilder() {}

public:
	IClass1* GetResult() {
		return iclass1;
	}

public:
	virtual void InitStep1() = 0;
	virtual void InitStep2() = 0;
	virtual void InitStep3() = 0;
};


/**
* 稳定的构建流程
*/
class IClassDirector {
private:
	IClassBuilder* iclassBuilder;

public:
	IClassDirector(IClassBuilder* iclassBuilder) :
		iclassBuilder(iclassBuilder)
	{
	}
	void Construct() {
		iclassBuilder->InitStep1();
		iclassBuilder->InitStep2();
		iclassBuilder->InitStep3();
	}
};
